package com.hong.spring.annotation;

import com.hong.spring.common.entity.User3;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Auther: csh
 * @Date: 2020/7/10 10:43
 * @Description:
 */
public class AnnotationTest {
    public static void main(String[] args) {
//从类路径的xm文件载入上下文定义的信息
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:/annotation/applicationfile-required.xml");
        System.out.println("context 已启动!");
        User3 user3 = context.getBean("user3", User3.class);
        System.out.println(user3.getName());
    }
}
